

$(document).ready(function () {
  var _maxHeight = $container().height();


  $('#btnAdd').click(function () {
    $('#modal-form').modal({
      show: true,
      backdrop: false
    });
  });

  $('#modal-form').on('hide.bs.modal', function () {
    alert('关闭模态窗口!');
  });

  $('#table1').bootstrapTable({
    url: _CTX_ + '/static/json/table_data.json',
    method: 'get',
    height: _maxHeight - 210,
    pagination: true,
    pageNumber: 1,
    pageSize: 20,
    pageList: [20, 50, 100],
    clickToSelect: true,
    search: true,
    searchOnEnterKey: true,
    showRefresh: true,
    toolbar: '#toolbar1',
    columns: [{
      radio: true
    }, {
      field: 'name',
      title: '姓名'
    }, {
      field: 'star',
      title: '关注度'
    }, {
      field: 'license',
      title: '许可方式'
    }, {
      field: 'description',
      title: '描述'
    }, {
      field: 'url',
      title: '链接地址',
      visible: false
    }]
  })

  $('#table1').on('check.bs.table',function(event,row){
    alert("选择了" + row.name);
  });

  $('#table2').bootstrapTable({
    url: _CTX_ + '/static/json/table_data.json',
    method: 'get',
    height: _maxHeight - 210,
    pagination: true,
    pageNumber: 1,
    pageSize: 20,
    pageList: [20, 50, 100],
    clickToSelect: true,
    search: true,
    searchOnEnterKey: true,
    showRefresh: true,
    toolbar: '#toolbar2',
    columns: [{
      radio: true
    }, {
      field: 'name',
      title: '姓名'
    }, {
      field: 'star',
      title: '关注度'
    }, {
      field: 'license',
      title: '许可方式'
    }, {
      field: 'description',
      title: '描述'
    }, {
      field: 'url',
      title: '链接地址',
      visible: false
    }]
  })

})